{layout name="lottery/header" /}
<div id="app">
    <div class="lottery-wrapper my-record j_wrapper" style="background-image: url(lottery_static/img/bg-my-record.png);background-size: cover;">
        <p class="gift-back" @click="location.replace('/index/lottery/info/id/'+lottery.id)">返回</p>
        <p class="page-title">中奖记录</p>
    
        <div class="record-list">
    
            <div class="record-item clear" v-for="i in prize_list">
                <div class="img-area">
                    <img :src="i.img">
                </div>
                <div class="txt-area" >
                    <p class="name">{{i.name}}</p>
                    <p class="date">{{i.time}}</p>
                    <p class="to-fill" v-if="i.record"><a href="#" @click="record(i.id)">填写联系方式</a></p>
                </div>
            </div>
    
        </div>

    
        <!--<p class="tips">请如实填写联系方式，登记后工作人员会与您联系核实相关身份信息以便发放奖品。客服电话：028-。</p>-->
    
    
    </div>
    {include file="lottery/extend"}

</div>
<script>


</script>
<script>
    new Vue({
        el:"#app",
        data:{
            lottery:{$lottery},
            prize_list:[],
        },
        created:function () {
            var windowHeight = window.innerHeight;
            //给高度赋值
            $('.lottery-wrapper').css('min-height', windowHeight);

            this.getPrizeList();
        },
        methods:{
            getPrizeList:function () {
                var _this = this;
                $.post("{:url('getMyPrize')}",{id:_this.lottery.id},function(res){
                    console.log(res);
                    _this.prize_list = res.data.list;
                },'json')
            },
            record:function (id) {
                window.location.href = "{:url('record')}" + "/id/" + id
            }
        }
    })
</script>